class Cat:
    type = '猫'

    def __init__(self,nickname,age,color):
        self.nickname = nickname
        self.age = age
        self.color = color

    def eat(self,food):
        print('{}喜欢吃{}'.format(self.nickname,food))

    def catch_mouse(self,color,weight):
        print('{}抓到了一只{}千克的，{}的老鼠'.format(self.nickname,weight,color))

    def sleep(self,hour):
        if hour < 5:
            print('继续睡吧')
        else:
            print('该起床了')


cat1 = Cat('小花',2,'白色') # 创建对象
cat1.eat('鱼') # 通过对象，调用方法
cat1.catch_mouse('黑色',1)
cat1.sleep(6)
